function [ delta_acc ] = acceleration_derivative( acceleration_x, acceleration_y, acceleration_z )

N = 11; % the point of moving average filter
N_2 = 5;
len = length(acceleration_x);

delta_acc = zeros(len, 1);

for i = 3 : N_2 + 1
    for j = 2 : (i + (i - 2))
        delta_acc(i) = delta_acc(i) + delta_a( acceleration_x(j - 1), acceleration_y(j - 1), acceleration_z(j - 1), acceleration_x(j), acceleration_y(j), acceleration_z(j) );
    end
    delta_acc(i) = delta_acc(i) / ((i - 2) * 2 + 1);
end

for i = (N_2 + 1 + 1) : (len - N_2)
    for j = (i - N_2) : (i + N_2)
        delta_acc(i) = delta_acc(i) + delta_a( acceleration_x(j - 1), acceleration_y(j - 1), acceleration_z(j - 1), acceleration_x(j), acceleration_y(j), acceleration_z(j) );
    end
    delta_acc(i) = delta_acc(i) / N;
end

for i = (len - N_2 + 1) : (len - 1)
    for j = (i - (len - i)) : len
        delta_acc(i) = delta_acc(i) + delta_a( acceleration_x(j - 1), acceleration_y(j - 1), acceleration_z(j - 1), acceleration_x(j), acceleration_y(j), acceleration_z(j) );
    end
    delta_acc(i) = delta_acc(i) / ((len - i) * 2 + 1);
end

delta_acc(2) = delta_a( acceleration_x(1), acceleration_y(1), acceleration_z(1), acceleration_x(2), acceleration_y(2), acceleration_z(2) );
delta_acc(1) = delta_acc(2);
delta_acc(len) = delta_a( acceleration_x(len - 1), acceleration_y(len - 1), acceleration_z(len - 1), acceleration_x(len), acceleration_y(len), acceleration_z(len) );

end